package logic

import (
	"context"
	"house_srv/model/mysql"

	"house_srv/house"
	"house_srv/internal/svc"

	"github.com/zeromicro/go-zero/core/logx"
)

type ListHouseLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewListHouseLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListHouseLogic {
	return &ListHouseLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *ListHouseLogic) ListHouse(in *house.ListHouseRequest) (*house.ListHouseResponse, error) {
	h := mysql.House{}
	err := h.ListHouse(int(h.ID))
	if err != nil {
		logx.Error("房源详情查询失败:", err)
		return nil, err
	}

	return &house.ListHouseResponse{}, nil
}
